<template>
  <!-- 楼盘管理主页 -->
  <el-form :inline="true" class="demo-form-inline" size="mini">
    <el-form-item label="" v-for="nav in county" :key="nav.id">
      <el-select
        v-model="nav.op"
        :placeholder="nav.name"
        @change="getvaluemethod($event)"
        :clearable="true"
      >
        <el-option
          v-for="op in nav.children"
          :key="op"
          :label="nav.value"
          :value="op"
        >
        </el-option>
      </el-select>
    </el-form-item>
    <!-- <el-form-item>
      <el-form-item label="全部区县">
        <el-select v-model="zoneOfAction">
          <el-option></el-option>
        </el-select>
      </el-form-item>
    </el-form-item> -->
    <el-form-item label="">
      <el-input v-model="priceAvg" placeholder="楼盘均价"></el-input>
    </el-form-item>
    <el-form-item>
      <el-input v-model="floorName" placeholder="楼盘名称"></el-input>
    </el-form-item>
    <el-form-item>
      <el-input v-model="floorId" placeholder="楼盘编码"></el-input>
    </el-form-item>
    <el-form-item>
      <el-button type="1" @click="queryBtn">查询</el-button>
    </el-form-item>
    <el-form-item>
      <el-button type="2" @click="emptyBtn">清空</el-button>
    </el-form-item>
  </el-form>
</template>

<script>
import Vue from "vue";
export default {
  name: "naviation",
  props: ["dropDownMenuData"],
  data() {
    return {
      event: "",
      // 活动区域
      zoneOfAction:'',
      // 装搜索框里面的所有值
      searchData: [],
      // 价格搜索框
      priceAvg: "",
      //   楼盘名称
      floorName: "",
      //   楼盘编号
      floorId: "",
      navData: [
        "上架中",
        "未通过审核",
        "已下架",
        "草稿箱",
        "待分配楼盘",
        "待审核楼盘",
      ],
      model: "",
      //   搜索列表数据
      county: [
        {
          id: "1",
          name: "全部区县",
          children: ["青羊区", "武侯区", "高新区"],
        },
        {
          id: "2",
          name: "全部板块",
          children: ["大源", "云华", "高新"],
        },
        {
          id: "3",
          name: "全部业态",
          children: ["住宅", "商铺", "写字楼"],
        },
        {
          id: "4",
          name: "责任分析师",
          children: ["张三", "李四", "王五"],
        },
        {
          id: "5",
          name: "楼盘分析师",
          children: ["赵六", "小明", "小红"],
        },
        {
          id: "6",
          name: "楼盘权重",
          children: ["1级", "2级", "3级", "4级", "5级"],
        },
        {
          id: "7",
          name: "合作形式",
          children: ["未合作", "分销合作", "尾盘合作", "普通合作"],
        },
      ],
    };
  },
  methods: {
    queryBtn() {
      this.searchData.push(this.priceAvg);
      this.searchData.push(this.floorName);
      this.searchData.push(this.floorId);
      console.log(this.searchData);
    },
    // 获取选取的下拉框的值
    getvaluemethod(event) {
      this.searchData.push(event);
    },
    // 清空
    emptyBtn() {
      this.searchData = [];
      // console.log(this.county);
      // this.county.children = [];
      this.priceAvg = "";
      this.floorName = "";
      this.floorId = "";
      // for(let i=0;i<this.county.length;i++){
      //   this.$delete(this.county[i],'op')
      // }
      // 清空下拉菜单
      this.county.forEach((item) => {
        this.$delete(item, "op");
      });
    },
  },
};
</script>

<style>
</style>